package sy5_3;

public class ATM {
    private Card card;
    public Card getCard(){
        return card;
    }
    public void setCard(Card card){
        this.card=card;
    }
    public void getCardMoney(){
        System.out.println("当前余额："+card.getMoney());
    }
    public void withDraw(int m) throws moneynotenough {
        if (m>card.getMoney()) throw  new moneynotenough("余额不足！");
        double money = card.getMoney()-m;
        card.setMoney(money);
    }
}
